# 1.写一个函数,然后写单元测试
# def run(num):
#     return num+1
# import unittest
# from myfun import run
# class MyTest(unittest.TestCase):
#     def setUp(self):
#         pass
#     def tearDown(self):
#         pass
#     def testrun(self):
#         self.assertEqual(run(1),2,'测试run函数失败')
#
# if __name__ =='__main__':
#     unittest.main()


# # 2.自定义一个类,完成单元测试
# class Jsz():
#     def __init__(self,name):
#         self.name = name
#     def work(self):
#         print('这是功能函数')
# from myfun import Jsz
# import unittest
#
# class MyClasTest(unittest.TestCase):
#
#     def setUp(self):
#         self.p = Person('jsz')
#
#     def tearDown(self):
#         self.p = None
#
#     def testwork(self):
#         self.p.work()
# if __name__ == __'__main__':
#     unittest.main()
